package Adapter_Pattern.Database;

import java.util.Scanner;

// -*-coding:utf-8 -*-
//人员：刘陆鑫
//班级：19软3
//学号；2019110218
public class client {
    public static void main(String[] args) {
        Database database=new Database();
        database.setName("llx");
        database.setPassword("123");
        Scanner scanner=new Scanner(System.in);
        System.out.println("使用对象选1，使用类选2");
        int a= scanner.nextInt();
        if(a==1){
            Object_adapter object_adapter=new Object_adapter();
            System.out.println("姓名为"+database.getName());
            System.out.println("开始加密姓名");
            object_adapter.OtherClass(database.getName());
            System.out.println("密码为"+database.getPassword());
            System.out.println("开始加密密码");
            object_adapter.OtherClass(database.getPassword());

        }
        else if(a==2){
            Class_adapter class_adapter=new Class_adapter();
            System.out.println("姓名为"+database.getName());
            System.out.println("开始加密姓名");
            class_adapter.OtherClass(database.getName());
            System.out.println("密码为"+database.getPassword());
            System.out.println("开始加密密码");
            class_adapter.OtherClass(database.getPassword());

        }

    }
}
